package com.lyc.campuslife.controller;


import com.lyc.campuslife.dto.Result;
import com.lyc.campuslife.entity.ShopType;
import com.lyc.campuslife.service.IShopTypeService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lyc
 * @since 2024-05-07
 */
@RestController
@RequestMapping("/shop-type")
@Api(tags="店铺类型接口")
public class ShopTypeController {
    @Resource
    private IShopTypeService typeService;

    @GetMapping("list")
    public Result queryTypeList() {
        List<ShopType> typeList = typeService.getList();
        if(typeList!=null)
            return Result.ok(typeList);
        else return  Result.fail("查无店铺类型列表");
    }
}
